using System.Collections.Generic;
using Token = TBit.Compile.ASMCompile.Token;
using TBit.Compile;

namespace TBit.Instrcutions {
    public static class Pop {
    
        public static int Compile(List<Token> tokens,VM vm,int i) {
            return ASMCompile.StructureInstruction_OPCODE(Opcode.POP,tokens,vm,i);
        }
        public static Instruction Create() {
            Instruction inst = new Instruction();
            inst.opcode = Opcode.POP;
            return inst;
        }

        public static int Run(VM vm,Instruction inst){
            InstructionArgData arg1 = inst.args[0];
            if(vm.call_stack.Count > 0)
            {
                vm.MemoryPop();
            }
            return 1;
        }
    }
}